home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
batch
/
tsbat30
/
tsbat.nws
< prev
next >
Wrap
Text File
|
1991-12-07
|
25KB
|
432 lines
University of Vaasa, Finland, MIPS 2030 workstation garbo.uwasa.fi
has a large collection of PD and shareware PC programs available by
anonymous ftp or mail server. The file /pc/ts/0news-ts contains news
about the TS-programs in the /pc/ts directory (in reverse order).
This text, which you now have, is an edited extract from the
0news-ts file, and the feedback fback028.arc file.
...................................................................
Prof. Timo Salmi
Moderating at garbo.uwasa.fi anonymous ftp archives 128.214.87.1
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun
...................................................................
Sat 7-Dec-91: I have updated my collection of useful batch files. It
is now garbo.uwasa.fi:/pc/ts/tsbat30.zip.
Alan Clark (clark@odie.ee.wits.ac.za) suggested that the screen
blanking batches could well do with a method to totally hide the
cursor while blanked. I have looked into this and noticed that this
can be easily achieved without extra programs by using ansi escape
sequences. BLK.BAT shows how to do it. (You'll have to activate
cursor hiding by editing three rems away).
Added LC.BAT line count for text files.
Added TEST33.BAT Test for MsDos 3.3 or later, batch demo
Sat 9-Nov-91: I have updated my collection of useful batch files to
be garbo.uwasa.fi:/pc/ts/tsbat29.arc. It includes PUSHDIRE.BAT,
SETPUSHD.EXE, and POPDIRE.BAT for pushing and poppoing the current
directory (utilizing environment variables). I have added a /q
switch for quiet operation (no echoing of the environment variables)
at a suggestion from Doug Tooley, djtooley@lotus.uwaterloo.ca.
I have added a TESTANSI.BAT batch (with accompanying ISANSI.EXE)
which can be used to test whether any ansi-type screen driver is
installed and thus available.
There are also some minor adjustments in a couple of the old
batches.
Get this package even if you do not need the individual batches.
There is much to learn from them about MsDos and batch usages. Many
Frequenly Asked Questions (FAQs) are implicitly answered by looking
at these files.
Sun 20-Oct-91: I have a collection of useful batch files which I
have updated to be garbo.uwasa.fi:/pc/ts/tsbat28.arc.
I have added a LEVEL.BAT testbench batch for testing the error
level returned by programs.
I have updated the ASK.EXE batch file enhancer. It now has the
option to of returning with a timeout errorlevel. The usage of
this enhancer is:
ASK [Prompt] [/b] [/d] [/l] [/t##] [/u]
! ! ! ! +- convert to Upper case
! ! ! +- Time-out parameter (0 = forever)
! ! +- convert to Lower case
! +- Direct read (no <-+ needed)
+- Batch mode (needed only if no prompt)
I have added an ASKENV.EXE batch file enhancer to the collection.
It is similar to ASK.EXE, but instead of returning an errorlevel
value, it sets the (parent's) environment variable ASKENV value
equal to the user's response.
Mon 9-Sep-91: I have updated my collection of useful batch files. It
is now /pc/ts/tsbat27.arc.
Four of the batches in the package has been updated. Of these
DAILY.BAT for running a program no more than one a day (eg from
autoexec.bat) utilized ENTER.TXT to simulate pressing the enter key.
This is no longer necessary but has been rewritten (with a trick
with the echo command) in a way that no longer needs this separate
file. My thanks to Ran Cheremsh CHERMESH%BGUVM.BITNET for reporting
the problem.
SCANZ for scanning .ZIP files for viruses had a bug in the
routine for scanning embedded .ZIPs.
Tue 9-Jul-91: I have updated my collection of useful batch files. It
is now /pc/ts/tsbat26.arc.
Note that even if you don't perhaps need the same batches as I
do, these batches may teach you many useful batch programming
tricks which I have accumulated during my PC years.
Made a number of minor stylistic corrections.
Since someone cracked the pkzip 1.10 authenticity (-av) code some
BBSes have been putting in their own ads as the authenticity labels.
A new batch rezip.bat removes these labels, which may give the users
a false sense of security.
Added a simple batch ruler.bat which shows the screen columns
using ansi codes to avoid excessive scrolling.
I have my ramdisk on currently on drive R on my PCs which I use
at home and at office. For whatever it is worth I have updated the
batches to reflect this change. Some of the batches require anyway
that you edit the paths in them to reflect yours, so no added
problem arise because of this. And, if you have your own ramdisk,
say, on d:, you can put the statement subst r: d:\ eg in your
autoexec.bat file to avoid the need of editing just because we may
happen to have ramdisks on different drives. (To be accurate there
is no absolute need of your d: physically being a ramdisk. But it
makes things a bit faster.)
Sun 12-May-91: I have updated my collection of useful batch files to
be /pc/ts/tsbat25.arc.
One of the constant worries of downloaders of archived packages
is the threat of viruses. (Games from shady BBSes are particularly
susceptibe, but even commercial products have been known to be
infected). Fortunately there are good virus checkers like McAfee's
/pc/virus/scanv77.zip and Fridrik Skulason's /pc/virus/fp-115a.zip
available to check for infections. There are, however, two dilemmas
in checking archived packages on a routine basis. (Since the format
garbo.uwasa.fi archives mostly uses is .zip let's speak of zipped
files). The first problem is that there are so many executable
compressors in use currently (such as lzexe, pklite, diet, tinyprog,
etc). This means that unless the virus checking programs can observe
all these variations, a virus can be hiding in an execompressed
form. Therefore it is advisable to expand the executables for the
check. A second problem is that .zip files occasionally contain
embedded .zip files (eg PC-Magazine's collections often do). These
embedded .zip files must be unzipped for a closer examination.
The earlier versions of the tsbat collection included a batch
called scanzip.bat. I have completely rewritten this batch to take
care of the two eventualities discussed above. I have renamed the
rewritten batch scanz.bat. Note that before using this new batch,
you have to go through scanz.bat and edit all the directory path
references to correspond to your own configuration. This is, of
course, an inconvenience, but it is the best way of guaranteeing
that a batch complicated as this stays reasonably efficient.
Wed 13-Mar-91: I have written a menu based ansi.sys driven advanced
batch for sending command codes to the printer to make printer
initialization and setting easy. It is called setprn.bat. It is for
Diconix Inkjet Parallel Printer Model 150, which is an Espon
compatible printer. Thus the batch is suitable for various different
printer makes, and easily configurable. I have added this batch to
my collection of (hopefully) useful and instructive batch files
/pc/ts/tsbat24.arc best available by anonymous ftp from
garbo.uwasa.fi archives. There is a program-based alternative to
setprn.bat, that is setdico.exe which can be found in
/pc/ts/tsprn##.arc. The difference is that in setprn.bat you are
able to configure the printer codes if you wish.
Sat 29-Dec-90: I have programmed a fair number of MsDos batch files
to make up a batch file collection of hopefully both useful and
instructive batches. I have updated the collection to be version
/pc/ts/tsbat23.arc by adding some new batches.
...
FU.BAT is a poor man's function evaluator utilizing gwbasic that
(usually) belongs automatically to the MsDos delivery. The basic
idea (pardon the pun) of combining batch and gwbasic programming is
not really mine. I got it from the PC-Magazine. The code of this
batch, however, is entirely due to yours truly.
...
ASK.EXE is a common batch file enhancer returning as errorlevel
the ascii value of the first character of the user's response.
An example of a simple batch utilizing ASK:
echo off
ASK Yes or no? /d /u
if errorlevel==89 if not errorlevel==90 echo It was a yes
if errorlevel==78 if not errorlevel==79 echo It was a no
echo on
My ask has switches for lower case (/l) and upper case (/u)
conversions, and (/d) "direct" reads without needing to press the
enter key. The ask prompt may include escape sequences for ansi
graphics. This is a feature not always available in other ask
programs.
Ok, there are countless ask batch enhancers already around, so
why yet another. Simply so that then tsbat23.arc has it, and you
don't have to get one separately. Furthermore, this ask is both
simple and general enough to be easy to use while being still
flexible.
BTW, ask is the one command which the original MsDos batch
programming most conspicuously lacks and needs. So many other
seemingly lacking features are embedded in MsDos, and you just have
to ferret them out. That's partly what tsbat23.arc collection is
about.
...
SAFEDEL.BAT is a generalized batch for deleting files. It asks
for confirmation for each file to be deleted. The usage is
SAFEDEL [FileName1] [FileNam2] ...
and wildcards are allowed.
...
MENU.BAT show show to build menus for easy program selection by
the user. This batch utilizes ask.exe, and is livened up by ansi
graphics.
...
UNPACK.BAT has been updated. It extracts, tests, and views packed
files (archives) irrespective of the packing method. The update
handles also .arj files (the new arrival sent packing on the scene).
Mon 22-Oct-90: I have updated my batch file collection to be
/pc/ts/tsbat22.arc. PC-Magazine Vol 9 Num 14 published a batch to
com file compiler bat2exec.com by Douglas Boling which is in the
/pc/pd2/bat2ex13.zip package at chyde.uwasa.fi archives. As would be
expected a batch compiler is more stringent in its requirements than
MsDos. Consequently I have gone through the batches in my collection
and seen to it that they are compilable. Note that in doing this I
have not altered the tasks of the batch files, nor have I included
the resultant compiled .com files. Where needed, I have just
adjusted the batches to conform with bat2exec.com compiler
requirements.
Among others there is an addpath.bat batch for adding directories
to the path without needing to rewrite the whole path as the
ordinary path command would require. In a similar manner there is
delpath.bat to omit a single directory from the path. Delpath.bat
needs an auxiliary batch file called setvar.bat, which must be
available to the delpath.bat. Delpath now checks whether the
auxiliary setvar.bat file is available in the current directory or
at path before running the rest of delpath.bat.
When a batch contains a call to a program, the program must
either be in the current directory, at path, or the call must
contain the path to the program. The last method has the
disadvantage of requiring adaptation to user's own structure.
Therefore the most general method is having the necessary program(s)
at path. If the program is not available, a normal batch ends in a
"Bad command or file name" error message. This gives very little
information of the cause of the problem. Therefore I have added
routines in the batches to precheck that the required program(s) are
indeed at path, and if not, issue a proper error message telling
what exactly is awry. (The batch trick here is testing whether a
given file is at path.)
An additional note. Batches like delpath.bat cannot obviously be
compiled successfully with bat2exec because of its need of an
auxiliary batch. Another batch that works as a normal batch file,
but won't work when compiled is color.bat. Color.bat sets the screen
color attributes using ansi code. Bat2exec.exe compiler has similar
problems with some other batches as well, but this does not affect
the user of these batch files in any way.
I have added blk.bat as an alternative simple screen saver to
complement blank.bat. Blk.bat stores the screen before blanking and
pops it when you exit the saver.
Fri 13-Jul-90: One of the operators at our computer centre asked me
today whether I know a replacement utility for MsDos diskcopy to
copy a 1.2Mb floppy to another without having to change the disks
more than once. This is because MsDos diskcopy.com requires a total
of five disk changes in the process, and besides this being tedious
one easily gets things mixed up. If you look at things this way,
scopy.bat in /pc/ts/tsbat21.arc does exactly what he was asking for,
in a single step. But on the balance, you must have the target disk
formatted before you begin the process (diskcopy does that for you,
if necessary). This batch method works easily, though, only if the
diskette to be copied has no subdirectories.
Sun 24-Jun-90: I have updated my batch file collection to be
(/pc/ts)/tsbat21.arc. This time I have added my rendition of setting
the screen text color and background. The color.bat batch uses ansi
color codes. (Thus you must have loaded ansi.sys driver, or its
enhanced equivalent (such as nansi.sys or zansi.sys). In other words
your config.sys must have a line like device=\sys\zansi.sys in it).
Version tsbat20 introduced a scanzip.bat batch as a shell to scan
.zip packages for viruses utilizing McAfee's scan.exe virus checker.
In addition to unzipping the .zip files into a temporary directory
the batch uncompressed lzexec .exe files, if any, using Alan
Posner's (/pc/pd2) isl12.zip and Mitugu Kuriziono's
(/pc/pd2/)unlzexe5.zip. With the introduction of version
(/pc/virus/)scanv63.zip uncompression lzexed executables is no
longer necessary, and I have adjusted the batch accordingly. I have,
however, done this by just commenting away parts of the batch, so
that you can still apply it if you have earlier than scan.exe
version 63. I have also added checking overlay files in addition to
.exe and .com files.
Please note that your email comments, feedback and suggestions on
the ts-programs would be welcome. And if you want to look at other
users' feedback, you can see it by getting /pc/pd2/post##.txt (## =
01, 02, and so on).
Thu 7-Jun-90: Lzexed files pose a problem for the present virus
scanners. While waiting to see the announced scanv63 to appear with
abilities to scan lzexe-compressed files, I wrote a batch to handle
scanning .zip packages. This batch checks both ordinary and lzexed
files within a .zip package. The following shareware and PD programs
are needed: pkunzip.exe, scan.exe, islzexe.exe, unlzexe.exe, The
packages containing these programs can be found from good BBSes and
eg from chyde.uwasa.fi by anonymous ftp. The new batch scanzip.bat
is included in the updated /pc/ts/tsbat20.arc batch file collection.
Fri 1-Jun-90: Released version /pc/ts/tsbat19.arc of my batch files
collection. It includes two new batches. There is a poor man's
screen save blank.bat, and there is an extension of the MsDos type
command show.bat, which allows the usage of wildcards and multiple
file names. You'll decide yourself if there is any usage for a
wildcard type. Myself, I do not see any outright, but the batch
itself is a very good exercise in batch programming. If you are new
to this aspect of MsDos, I think you will learn many useful tricks
from batches like this. - Where possible, I have tried to write the
batches in a way that they need a minimum about of auxiliary files
or such auxiliary programs, which are not part of MsDos (internal or
external) commands. - I have rewritten lastboot.bat (recording the
previous boot time of your PC) and logrun.bat (recording program
usage) so that they no longer need the auxiliary files enter.txt and
star.txt, which have been deleted from the new version. - There are
some stylistic changes in scopy.bat.
Sat 17-Mar-90: Released a new version /pc/ts/tsbat18.arc of my batch
files collection. - It seems that this batch collection has become
perhaps the most popular of my packages judging from the recent
download figures and the comments from users. (A note written later:
The most downloaded package of mine is the Frequently Asked
Questions /pc/ts/tsfaq##.arc, by a broad margin). - Corrected a
small bug in c.bat that prevented going back to the root directory.
- Built a simple batch lastboot.bat for displaying the date and time
of the previous booting. - Also built a new batch virus.bat. This
batch makes a directory both prior and after running the suspect
program, and gives a warning if the directories differ, and prepares
a list of the differences. The batch can be also used by a
knowledgeable user for the more benevolent similar purpose of
checking what files a certain programs changes.
*Flame off* One lesson to be learned from batch programming is
that properly used MsDos can be quite flexible. I think it is here
to stay for a long time yet Unix and OS/2 notwithstanding. And this
does not mean castigating Unix nor OS/2. (Any discussion of this
aspect to the proper newsgroups, if you please.) *Flame on* :-)
Sun 11-Mar-90: Released a new version /pc/ts/tsbat17.arc of my batch
files collection. This update introduces a batch shell unpack.bat
for extracting, testing, and viewing packed files irrespective of
the packing method.
Sun 04-Mar-90: My batch file collection is now version (/pc/ts/)
tsbat16.arc. - Addpath.bat appending new directories to the path now
checks whether the directory exists, and whether the directory
already is at path, thus preventing mistakes by the user. I use this
batch myself a lot, and since I often make typing errors, I wanted
the batch to do the validity checking for me. - Arc2zip.bat
converting an .arc file to a .zip file, with comment, has added
safeguards against errors and corrupted archives. - Deldir.bat for
deleting the files from a directory and then removing the directory,
has been rewritten. - There are also new batches in the collection.
- There is a harddisk version of the packing methods converter
called zoo2arch.bat. It is a .zoo to .zip converter eg for those who
prefer tighter .zip files over the binary posting's current .zoo
packing method. - If you have been annoyed by the fact that MsDos
cannot take more than one command per command line, m.bat is the
batch for you. It is a batch that facilitates giving multiple MsDos
commands. Another new batch is d.bat. It gives the directory with
sort and generalized name matching. - Also managed to resist the
temptation to rename the documentation to the obvious bat.man.
Thu 25-Jan-90: I have updated my batch file collection to be version
(/pc/ts/)tsbat15.arc. There is just one addition, daily.bat. It is
intended to run a program from the autoexec.bat file only once in a
day. There are programs in circulation, which achieve the same
thing as daily.bat. The trick in daily.bat is that it is a true
batch file without the need of any external user-made programs.
This not a very difficult to do, but tricky enough to be
interesting and educational.
Tue 16-Jan-90: I have still been thinking about batch files and
interesting tricks to do with them, and I therefore publish a new
upgrade of my botch :-) collection in a rapid succession after the
last update. The upgrade is (/pc/ts/)tsbat14.arc, and it will be
available by anonymous ftp at least from chyde.uwasa.fi, Simtel20,
and by BBS download or file request from Micro Maniacs Opus 2:515/1
telephone 358-0-425966. Two new utilities are included. The first is
delpath.bat, which removes a directory from the path variable. This
was a really tricky one, and my solution (contrary to the other
batches in the collection) requires MsDos version 3.30 because it
uses the call command. I have since seen another solution in the
PC-Magazine (Vol 8 No 21) but mine uses a somewhat different
technique, and should be clearer because even I can understand how
mine works :-). The second new batch is deldir.bat for deleting the
files from a directory and then removing the directory. This is
really trivial, but I needed it myself. I have tried to include
reasonable number of safeguards within this batch.
Sun 14-Jan-90: I have updated my batch file collection to be version
(/pc/ts/)tsbat13.arc.
There is a new batch arc2zip.bat for converting an .arc file to a
corresponding .zip file. The batch automatically adds your zip-file
comment to the converted .zip. Also, the date of the zip file is
automatically set to the date of the latest file within the .zip,
not the date of the conversion.
Another new batch is zipdate. It demonstrates how to datestamp
.zip packages.
The new version also includes a second addpath utility. It is
apath-om.bat and is by Otto Makela. It is included in my batch file
collection with Otto's explicit permission. Thanks Otto. This batch
nicely demonstrates testing a condition (is a directory already in
the path) in MsDos batch programming. I had an interesting time
testing Otto's batch and discussing the dilemmas in the earlier
versions after Otto posted the original version in the news in
alt.msdos.programmer. I think that we both gained in the process. I
would pleased to consider similar useful contributions from other
users, as well. If you are interested, contact me by email.
Where.bat has been rewritten. It finds a file by using a search
string on the file name. Contrary to the ordinary wildcarded MsDos
DIR-type convention, where.bat matches the search string anywhere
within the body of the file name. The updated where.bat has been
made case-insensitive (applies upper case conversion on batch
parameters).
Some of the other batches in the package have had their help
texts extended.
Sat 18-Nov-89: There are several nice memory resident push/pop
directory utilities around. As you know pushdir stores the name of
the directory where you are. You can then change the directory (and
the drive) as much as you like, and popdir takes you right back to
the original directory. But memory resident programs tend to pile
up, and I started thinking whether push/pop can be achieved using
non-resident batch methods. PUSHDIRE.BAT and POPDIRE.BAT together
with SETPUSHD.EXE do this by juggling the environment variables. I
pushed these files in my batch file collection and updated it to be
tsbat12.arc. You can pop them from there.
Tue 31-Oct-89: Released update /pc/ts/tsbat11.arc of my batch files
collection. The new release introduces LOGRUN.BAT. It can be used
for calling programs and logging the call in a usage log with
time/date information. The batch utilizes MsDos time and date
commands for making the usage log of the program calls. The bug
caused by the non-standard switch /i in the file finder WHERE.BAT
has been amended. A new batch LOCATE.BAT for locating a file (or
files) on a disk has been added. Contrary to WHERE.BAT it is not
case sensitive. The "change the directory" batch has been renamed
C.BAT (was SD.BAT). I have also added more comments within some of
the batches.
If you get an "Out of environment space" message in these, or any
other batches, try increasing your environment space by using shell
configuration in config.sys:
Example: shell=c:\bin\command.com c:\bin /e:1024 /p
Sun 29-Oct-89: I decided to introduce a batch file collection
/pc/ts/tsbat10.arc. The batches are quite straightforward, and do
not need any special auxiliary programs, just the ordinary MsDos
commands. Some of the batches are from my other utility packages,
some are new. I do not claim a high degree of originality. This is
because the methods and tasks of batch programming keep repeating
over and over again. But I hope that you will find some of my
tricks useful.
And if you feel that you have useful batches yourself, which you
would like to distribute to your fellow users, I would be interested
in considering any good ideas for development. Due credit would
naturally be given. I would, however, reserve the right to choose,
and to develop your batches to suit the future versions of this
Public Domain collection.
Thu 26-Oct-89: I have a private mailing list for emailing these
update news. Especially, if you have my programs downloadable at
your site or your BBS you are welcome to ask for inclusion on this
list by emailing to me at ts@chyde.uwasa.fi.